package com.itheima.thread.等待唤醒机制.快递案例;

import java.util.concurrent.ArrayBlockingQueue;

public class Demo {
    public static void main(String[] args) {
        ArrayBlockingQueue<String> arrayBlockingQueue = new ArrayBlockingQueue<>(5);
        for (int i = 0; i < 10; i++) {
            Delivery delivery = new Delivery(arrayBlockingQueue);
            delivery.setName(i + "号快递员");
            delivery.start();
        }

        User user = new User(arrayBlockingQueue);
        user.setDaemon(true);
        user.start();
    }
}
